KD_data = [
{
  "FID": 104164,
  "FBillNo": "HZP003832",
  "FRemainStockINQty": 101,
  "FMaterialId_fnumber": "CE01204000NDWHEV",
  "FQty": 200,
  "FTaxPrice": 242.67,
  "FPOOrderEntry_FEntryID": 109819,
  "FPurchaseOrgId_fnumber": "101",
  "FSupplierId_fnumber": "EV"
},
{
  "FID": 104164,
  "FBillNo": "HZP003832",
  "FRemainStockINQty": 100,
  "FMaterialId_fnumber": "CE01204000NDWHEV",
  "FQty": 100,
  "FTaxPrice": 242.67,
  "FPOOrderEntry_FEntryID": 109820,
  "FPurchaseOrgId_fnumber": "101",
  "FSupplierId_fnumber": "EV"
},
]

jkl_data = [
  {
    "recId": "46811",
    "goodsId": "1899403423234557696",
    "goodsNo": "CE01204000NDWHEV",
    "unitName": "个",
    "quantity": 151,
    "estCost": 36643.17,
    "estPrice": 242.67,
    "batchNo": "08/23",
    "sourceDetailId": "1920560288077087233",
    "purchDetlId": "1920560288077087233"
  },
  {
    "recId": "46812",
    "goodsId": "1899403423234557696",
    "goodsNo": "CE01204000NDWHEV",
    "unitName": "个",
    "quantity": 50,
    "estCost": 12133.5,
    "estPrice": 242.67,
    "batchNo": "08/23",
    "sourceDetailId": "1920560288077087234",
    "purchDetlId": "1920560288077087234"
  }
]

def get_FEntryID(jky_code, jky_qty, kd_list):
    for item in kd_list:
        # 如果金蝶的物料代码=吉客云的货品代码
        if item["FMaterialId_fnumber"] == jky_code:
            # 金蝶数量
            FRemainStockINQty = float(str(item.get("FRemainStockINQty")))
            # 且金蝶的数量大于吉客云的数量
            if FRemainStockINQty >= float(str(jky_qty)):
                # 金蝶商品数量减去吉客云商品数量
                item["FRemainStockINQty"] = FRemainStockINQty - float(str(jky_qty))
                # 返回金蝶id
                return item["FPOOrderEntry_FEntryID"]
    return None


# 主程序区
for i in jkl_data:
    # 源单分录内码：FInStockEntry_Link_FSId
    FInStockEntry_Link_dic =  {'FInStockEntry_Link_FSId': get_FEntryID(i.get('goodsNo'), i.get('quantity'), KD_data)}
    print(FInStockEntry_Link_dic)